/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package tbgb.resourcemanager;

import java.io.IOException;
import javax.microedition.lcdui.Image;

/**
 *
 * @author LưuQuang
 */
public class ImageResourceLoader implements ResourceLoader{
    public static final Integer RESOURCE_KEY = new Integer("ImageResourceLoader".hashCode());
    
    public Integer getResourceKey() {
        return RESOURCE_KEY;
    }

    public boolean isReuseResource() {
        return true;
    }

    public Object loadResource(String resourceName) {
        try {
            return Image.createImage(resourceName);
        } catch (IOException ex) {
            return null;
        }
    }
}
